package psd.scala.rules

import scala.collection.mutable
import psd.model.Bug
import org.eclipse.jdt.core.dom.Modifier
import psd.scala.FactDb


class MethodsWithoutArgs (description: String) extends AbstractRule(description){

	def execute(db: FactDb): mutable.ArrayBuffer[Bug]= {

    
   	 val methodDefTList = db.methodDefTList
   	 val classDefTlist = db.classDefTList 
   	 val result = new mutable.ArrayBuffer[Bug]
    
     val abstractClass = classDefTlist.filter(x => !x.isAbstract)
     
   	 /*for ( ab <- abstractClass ) {
   	   		   val absMethods = methodDefTList.filter(m => Modifier.isAbstract(m.modifier))
   	   				   				.filter(_.path == ab.path)
				if ( absMethods.isEmpty) {*/
     	if (abstractClass.isEmpty){
	   				 val bug = new Bug
				     bug.set_lineNumber(0)
				     bug.set_path("asd")
			    	 bug.set_ruleName(this.getClass().toString())
			    	 bug.set_description(this.description)
			    	 result+=bug
			    	 }
				 /*}
	   		 
	   	 }*/
	   	 return result
	  
  }
}